package com.freedy.algorithm.kruskal;


/**
 * @author Freedy
 * @date 2021/4/14 9:32
 */
public class Kruskal {
    public static void main(String[] args) {
        char[] data = {'A', 'B', 'C', 'D', 'E', 'F', 'G'};
        int[][] weight ={
                { 0, 12, 0, 0, 0, 16, 14},
                {12, 0, 10, 0, 0, 7, 0},
                {0, 10, 0, 3, 5, 6, 0},
                {0, 0, 3, 0, 4, 0, 0},
                {0, 0, 5, 4, 0, 2, 8},
                {16, 7, 6, 0, 2, 0, 9},
                { 14, 0, 0, 0, 8, 9, 0}};
        MGraph graph = new MGraph(data,weight);
        graph.printGraph();
        MinTree tree = new MinTree(graph);
        tree.createMinTree();
    }
}
